package com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.modle;

import android.content.Context;
import android.util.Log;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.bean.LoginInfoBean;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.contract.ILoginContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.utils.SharedPreferencesUtils;

/**
 * Created by Administrator on 2018/8/16.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class LoginModle implements ILoginContract.ILoginModle {
    @Override
    public void saveIsLogin(Context context) {
        SharedPreferencesUtils.getInstance(context).putDate("desk_media_is_login",true);
    }

    @Override
    public void sveLoginInfo(Context context, LoginInfoBean bean) {
        SharedPreferencesUtils mSharedPreferencesUtils = SharedPreferencesUtils.getInstance(context);
        mSharedPreferencesUtils.putDate("createTime",bean.getCreateTime());
        mSharedPreferencesUtils.putDate("creator",bean.getCreator());
        mSharedPreferencesUtils.putDate("updateTime",bean.getUpdateTime());
        mSharedPreferencesUtils.putDate("updator",bean.getUpdator());
        mSharedPreferencesUtils.putDate("delFlag",bean.getDelFlag());
        mSharedPreferencesUtils.putDate("id",bean.getId());
        mSharedPreferencesUtils.putDate("companyId",bean.getCompanyId());
        mSharedPreferencesUtils.putDate("deptId",bean.getDeptId());
        mSharedPreferencesUtils.putDate("type",bean.getType());
        mSharedPreferencesUtils.putDate("realName",bean.getRealName());
        mSharedPreferencesUtils.putDate("userName",bean.getUserName());
        mSharedPreferencesUtils.putDate("password",bean.getPassword());
        mSharedPreferencesUtils.putDate("enterTime",bean.getEnterTime());
        mSharedPreferencesUtils.putDate("leavingTime",bean.getLeavingTime());
        mSharedPreferencesUtils.putDate("tel",bean.getTel());
        mSharedPreferencesUtils.putDate("mobile",bean.getMobile());
        mSharedPreferencesUtils.putDate("email",bean.getEmail());
        mSharedPreferencesUtils.putDate("imageUrl",bean.getImageUrl());
        mSharedPreferencesUtils.putDate("sex",bean.getSex());
        mSharedPreferencesUtils.putDate("address",bean.getAddress());
        mSharedPreferencesUtils.putDate("careerId",bean.getCareerId());
        mSharedPreferencesUtils.putDate("mobileType",bean.getMobileType());
        mSharedPreferencesUtils.putDate("mobileDeviceId",bean.getMobileDeviceId());
        mSharedPreferencesUtils.putDate("companyName",bean.getCareerName());
        mSharedPreferencesUtils.putDate("status",bean.getStatus());
        mSharedPreferencesUtils.putDate("deptName",bean.getDeptName());
        mSharedPreferencesUtils.putDate("imageType",bean.getImageType());
        mSharedPreferencesUtils.putDate("careerName",bean.getCareerName());
        mSharedPreferencesUtils.putDate("queryChildrenDeptPerson",bean.getQueryChildrenDeptPerson());
        mSharedPreferencesUtils.putDate("queryStatus",bean.getQueryStatus());
        mSharedPreferencesUtils.putDate("deptIds",bean.getDeptIds());
        mSharedPreferencesUtils.putDate("messageId",bean.getMessageId());

    }

    @Override
    public void saveToken(Context context, String token) {
        SharedPreferencesUtils.getInstance(context).putDate("token",token);
    }

    @Override
    public void SaveIsChangePassword(Context context) {
        SharedPreferencesUtils.getInstance(context).putDate("desk_media_is_change_password",false);
    }
}
